package polymorphism;

public class Exercise1 {
  
  public static void main(String[] args) {
    Cycle cl1 = new Unicycle();
    Cycle cl2 = new Bicycle();
    Cycle cl3 = new Tricycle();
    
    cl1.ride();
    cl2.ride();
    cl3.ride();
  }

}

class Cycle {
  public void ride() {
    System.out.println("Cycle.ride()");
  }
}

class Unicycle extends Cycle {
  public void ride() {
    System.out.println("Unicycle.ride()");
  }
}

class Bicycle extends Cycle {
  public void ride() {
    System.out.println("Bicycle.ride()");
  }
}

class Tricycle extends Cycle {
  @Override public void ride() {
    System.out.println("Tricycle.ride()");
  }
}
